import request from '@/utils/request'

// 查询收件箱邮件列表
export function listMail(query) {
  return request({
    url: '/function/mail/inbox/list',
    method: 'get',
    params: query
  })
}
// 查询已发送邮件列表
export function listSendedMail(query) {
  return request({
    url: '/function/mail/list',
    method: 'get',
    params: query
  })
}


// 邮件指定文件
export function sendMail(query) {
  return request({
    url: '/function/mail/batch',
    method: 'get',
    params: query
  })
}

// 查询收件箱详情
export function getInboxMail(query) {
  return request({
    url: '/function/mail/inbox',
    method: 'get',
    params: query
  })
}
// 查询已发送详情
export function getDraftMail(query) {
  return request({
    url: '/function/mail/draft',
    method: 'get',
    params: query
  })
}

// 获取项目
export function getProjects(query) {
  return request({
    url: '/function/project/my/tabulate',
    method: 'get',
    params: query
  })
}

// 获取联系人
export function getLian(query) {
  return request({
    url: '/function/staff/aggregate/',
    method: 'get',
    params:query
  })
}


// 新增邮件
export function addMail(data) {
  return request({
    url: '/function/mail/add',
    method: 'post',
    data: data
  })
}

// 修改邮件
export function updateMail(data) {
  return request({
    url: '/function/mail',
    method: 'put',
    data: data
  })
}

// 删除邮件
export function delMail(id) {
  return request({
    url: '/function/mail/' + id,
    method: 'delete'
  })
}
// 获取用户
export function getPersons() {
  return request({
    url: '/system/user/allList',
    method: 'get'
  })
}

